home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 8605 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  6.6 KB

  1. Path: rintintin.Colorado.EDU!nelsoni
  2. From: nelsoni@rintintin.Colorado.EDU (Ian S. Nelson)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++
  4. Subject: Re: C/C++ knocks the crap out of Ada
  5. Date: 19 Feb 96 04:34:09 GMT
  6. Organization: University of Colorado at Boulder
  7. Message-ID: <nelsoni.824704449@rintintin.Colorado.EDU>
  8. References: <00001a73+00002504@msn.com> <3114d8fb.5a455349@zesi.ruhr.de> <4f5h5t$f13@vixen.cso.uiuc.edu> <4g1bgf$l5@mailhub.scitec.com.au> <4g2vn3$rgi@dfw.dfw.net> <4g8ook$bce@mailhub.scitec.com.au>
  9. NNTP-Posting-Host: rintintin.colorado.edu
  10. X-Newsreader: NN version 6.5.0 #8 (NOV)
  11.  
  12. ramsesy@rd.scitec.com.au (Ramses Youhana) writes:
  13.  
  14. >David Weller (dweller@dfw.net) wrote:
  15. >> In article <4g1bgf$l5@mailhub.scitec.com.au>,
  16. >> Ramses Youhana <ramsesy@rd.scitec.com.au> wrote:
  17. >> >Another thing not mentioned is that Ada is far more complicated to learn
  18. >> >fully than is C/C++.  The complexity of the language can add to an increase
  19. >> >in the probabilty of bugs being introduced and also adds to an increase in
  20. >> >project maintanace costs.
  21. >> >
  22.  
  23. >> Compared to C++?  You are wrong.  There are fewer features in C++, yet
  24. >> the (draft) reference manual is larger than Ada 95 (not that this is
  25. >> necessarily a good measure, but rather that a language that is less
  26. >> complex would hopefully require less "langauge" to specify it).  My
  27. >> personal experience with Ada 95 and C++ indicates the exact opposite
  28. >> of your conclusion.  I have a feeling you haven't used Ada 95 very
  29. >> much to make such claims.
  30.  
  31. >Sorry.  I had once heard that Ada was more complicated than C.  However, as
  32. >many people have posted and told me otherwise, I take the comment back.
  33.  
  34. >However, I am interested in knowing what the advantages and disadvantages C/C++
  35. >and Ada (or Ada 95) languages have over each other, without having to buy a
  36. >book on Ada (as I am unlikely to use it in my profession), especially for
  37. >engineering applications.
  38.  
  39. I'm not an Ada ninja or anything, I've done a fair bit of coding in it though.
  40. I've done a heap of coding in C++, I've been hacking around with it since
  41. around 1990.  I'll try to start it off though...  (and if you are an engineer
  42. then there is a decent chance that you might end up using Ada, it depends on
  43. who you work for though.)
  44.  
  45. These are all religious issues to a lot of people.  It is possible, IMO, to 
  46. write good C++ and to write crappy Ada.
  47.  
  48. For imparitive programming and in general:
  49.     *  C++ is not strong typed.  You can point a string to an integer
  50.        to a float and the most you'll usually get is a compiler warning.
  51.        C coders can use that ability to do neat things but in terms of 
  52.        language design, I think it is more desirable to only allow those
  53.        kinds of conversions if you mean it. Bad things can happen.
  54.     *  C++ functions can be anywhere.  On more than one occasion I have
  55.        had to result to using "grep" on a large directory of files because
  56.        a programmer decided to just throw it in to a file for no obvious
  57.        reason.  Ada coaxs programmers to put things together a little more.
  58.     *  Ada makes it more clear on what parameters for functions (procedures
  59.        and functions) do and what happens to them.  It is not uncommon to
  60.        send a pointer to a function in C++ even though the function doesn't
  61.        change anything.   
  62.     *  Here is a good religious issue: C and C++ pick lousy names for the
  63.        standard library functions and classes.
  64.     *  Ada is case insensitive.  C and C++ both care about the case you
  65.        use.
  66.     *  There are stylistic differences.  I can't think of a good way to
  67.        describe them.  When you design a big C++ program you do it 
  68.        differently than you do with Ada.  Surely someone else can explain
  69.        this more.  C++ code is structured into files, Ada is in packages,
  70.        they are just different in some holistic way.
  71.     *  C++ templates and exceptions are a pretty new standard for the
  72.        language, until recently the compiler vendor decided how to handle 
  73.        them.  They aren't really in wide use yet.
  74.     *  C++ won't let you range types: a la "type year is an integer from
  75.        -2000 to 2050" or like that.  
  76.     *  C++ enums are still typically just integers, is this changing?
  77.     *  C and C++ have macros, I don't think ada has a feature like that.
  78.     *  I'm not sure if this is a compiler feature or an Ada feature, but
  79.        Ada pays more attention to header files when compiling.  With C++
  80.        you can change one header file and it won't recompile your source
  81.        files unless you tell it to in your makefile.  I think Ada will 
  82.        notice those changes.
  83.     *  There is probably a larger amount of C and C++ code open to the 
  84.        public that you can draw from.
  85.     *  There are more C and C++ compilers.
  86.     *  There are more C and C++ books.
  87.     *  There is a certification process for Ada compilers, you take the
  88.        vendor's word for it in the C++ world.
  89.  
  90.     add more if you think they are relevent.  Please correct me if I messed
  91.     something up, today has been an overly productive code day and I'm 
  92.     drained.  
  93.  
  94. For objects:
  95.     Now this section is much more religious, that's just the nature of 
  96.     OOP...
  97.  
  98.     *  Ada doesn't have multiple inheritance, at least I don't think it
  99.        does.  This is subjective, there are ways around it and
  100.        many people think it is "dangerous."  I kind of like to have it as
  101.        an option though, if my object model demands that an object has to 
  102.        superclasses then I want it.  More importantly, if my boss gives me
  103.        an object model with a class that has two parents then I want it.
  104.     *  It's my opinion that Ada is more likely to bark at you if you 
  105.        forget to include a method.  I've written code that has outputed
  106.        pointer addresses to the screen because I didn't supply a method
  107.        and then I just threw in a cast because it gave me a warning.
  108.     *  Here is another really religious issue.  When I get really tired and
  109.        I'm doing C++, I resort to doing stupid tricks to make things 
  110.        compile (I hate leaving code broken overnight)  when I get a
  111.        compiler error I, in advertantly, do something stupid to "fix" it.
  112.        When I get a clean ada compile, I feel better about the code.  When
  113.        I get a clean C++ compile I question my test methodology.  You can
  114.        always force C++ to compile even if it does something really stupid.
  115.     *  Ada seems tobe easier to do large projects in.  In C++, it has been
  116.        my experience that work gets divided up between coders by class.
  117.        (eg: Bob, you do the string class.  Bill, you do the LZW class.
  118.        Sarah, you do the tree class... etc.) 
  119.     *  I think I like the emacs mode for ada more than the C++ mode that I
  120.        have.  
  121.     
  122.     surely there is a lot more to be said about this.  I'm starting to
  123.     have a lot of trouble typing so I'm going to stop now.
  124.  
  125. Ian
  126.  
  127. >Ramses.
  128.